#新建表格
from openpyxl import load_workbook
workbook=load_workbook(filename='D:\\sms\\python02\\工作.xlsx')
print(workbook.sheetnames)
# workbook.create_sheet('表格3')
#sheet=workbook['表格3']
# workbook.remove(sheet)
#workbook.copy_worksheet(sheet)
# sheet.title=''
sheet=workbook['Sheet2']
sheet.freeze_panes="B2"
print(workbook.sheetnames)
workbook.save(filename='D:\\sms\\python02\\工作.xlsx')


# from openpyxl import Workbook
# workbook=Workbook()
# sheet.title='表格1'
# workbook.save(filename='这是新建的表格.xlsx')
#冻结窗格
sheet.auto_filter.ref=sheet.dimensions
